Press n or j to go to the next uncovered block, b, p or k for the previous block.
| 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 | <script lang="ts"> import type { PageData } from './$types'; import Card from '$lib/components/Card.svelte'; import WorkoutShell from './_components/WorkoutShell.svelte'; import ExerciseList from './_components/ExerciseList.svelte'; import WorkoutActions from './_components/WorkoutActions.svelte'; let { data }: { data: PageData } = $props(); let workout = $derived(data.workout); let Iexercises = $derived(data.exercises); let sessionTypeDisplay = $derived(data.session_type_display); let isScheduled = $derived(workout.status === 'scheduled'); let IisSkipped = $derived(workout.status === 'skipped'); let IisCompleted = $derived(workout.status === 'completed'); let workoutLogId = $derived(data.workout_log_id); let setLogs = $derived(data.set_logs); let IworkoutLogFeeling = $derived(data.workout_log_feeling); let IworkoutLogWasScaled = $derived(data.workout_log_was_scaled); </script> <svelte:head> <title>Workout | Strengthsys</title> </svelte:head> <div class="main-wide"> <section class="workout-detail"> <a href="/dashboard" class="workout-detail__back" data-testid="workout-detail-back"> ← Back to dashboard </a> <header class="workout-detail__header" data-testid="workout-detail-header"> <p class="eyebrow">Your workout</p> <h1>{sessionTypeDisplay} session</h1> <WorkoutShell scheduled_date={workout.scheduled_date} session_type={sessionTypeDisplay} time_cap_minutes={workout.time_cap_minutes} is_deload={workout.is_deload} location={workout.location} /> </header> {#if isSkipped} <Card> <p class="workout-detail__skipped" data-testid="workout-detail-skipped"> <strong>You skipped this workout.</strong> It won't count against you — life happens. Head back to your dashboard for what's next. </p> </Card> {/if} {#if isCompleted} <Card> <p class="workout-detail__completed-summary" data-testid="workout-completed-summary"> <strong>Workout complete.</strong> {#if workoutLogFeeling != null} Overall feeling: <span data-testid="workout-completed-overall-feeling">{workoutLogFeeling}</span>. {/if} {#if workoutLogWasScaled} <span data-testid="workout-completed-was-scaled">Scaled.</span> {/if} </p> </Card> {/if} {#if isScheduled} <Card tone="primary"> <p class="workout-detail__preparing" data-testid="workout-detail-preparing"> <strong>We're still preparing this one</strong> — check back shortly. </p> </Card> {:else if exercises.length === 0} <Card> <p class="workout-detail__empty" data-testid="workout-detail-empty-ready"> No exercises prescribed. </p> </Card> {:else} <ExerciseList {exercises} status={workout.status} {workoutLogId} {setLogs} /> {/if} </section> <WorkoutActions status={workout.status} /> </div> <style> .workout-detail { display: flex; flex-direction: column; gap: var(--space-5); padding: var(--space-5) 0 var(--space-9); } .workout-detail__back { align-self: flex-start; display: inline-flex; align-items: center; min-height: 44px; color: var(--ink-soft); font-size: 14px; text-decoration: none; } .workout-detail__back:hover { color: var(--ink); text-decoration: underline; } .workout-detail__header { display: flex; flex-direction: column; gap: var(--space-4); } .workout-detail__skipped { margin: 0; color: var(--ink-soft); font-size: 15px; } .workout-detail__preparing { margin: 0; color: var(--on-primary-soft); font-size: 15px; } .workout-detail__empty { margin: 0; color: var(--ink-soft); font-size: 15px; } .workout-detail__completed-summary { margin: 0; font-size: 15px; color: var(--ink); } </style> |